package com.itheima.java.ai.langchin4j.server.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.java.ai.langchin4j.entity.Doctor;
import com.itheima.java.ai.langchin4j.mapper.DoctorMapper;
import com.itheima.java.ai.langchin4j.server.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements DoctorService {
    
    @Autowired
    private DoctorMapper doctorMapper;
    
    @Override
    public List<Doctor> getDoctorsByDepartment(String department) {
        return doctorMapper.findByDepartmentAndActive(department);
    }
    
    @Override
    public List<Doctor> getAllActiveDoctors() {
        return doctorMapper.findAllActive();
    }
    
    @Override
    public List<String> getAllDepartments() {
        return doctorMapper.findAllDepartments();
    }
    
    @Override
    public Doctor getDoctorById(Long doctorId) {
        return doctorMapper.selectById(doctorId);
    }
}